#include <stdio.h>
#include <string.h>

int findLUSlength(char* a, char* b)
{
    int alen = strlen(a);
    int blen = strlen(b);
    int len = alen > blen ? alen : blen;
    int max = 0;
    for(int i = 0;i < alen;i++)
    {    
        int count = 0;
        int n = i;
        for(int j = 0;j < blen;j++)
        {
            if(a[i++] == b[j])
                count++;
            else
                break;
        }
        max = max > count ? max : count;
        i = n;
    }
    return max;
}

int main()
{
    char a[] = "helloworld";
    char b[] = "worhel";
    int n = findLUSlength(a, b);
    printf("%d\n",n);
    return 0;
}